/**
 * Created by Administrator on 2018/1/17.
 */
document.addEventListener("error", function(e){
    var elem = e.target;
    if(elem.tagName.toLowerCase() === 'img'){
        elem.src = "img/juzix.png";
        var src = $(elem).data('img_url');  
        if (src != undefined) {
            if(typeof src.split == "function"){
                src = src.split(";");
            }
            src = src[0];
            var src1 = img_url + '/' + src;
            var img1 = new Image();
            img1.src = src1;
            img1.onload = function () {
                $(elem).attr({"src": src1,"data-is_loaded": true});
            }
            img1.onerror = function () {
                var img2 = new Image();
                img2.src = src;
                img2.onload = function(){
                    $(elem).attr({"src": src,"data-is_loaded": true});
                }
                img2.onerror = function(){
                    $(elem).attr({"src": "img/juzix.png","data-is_loaded": true});
                }
            }
        }
    }
}, true /*指定事件处理函数在捕获阶段执行*/);

